package com.example.test.rabbitmq;

import com.example.test.config.RabbitMqConst;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;

@Component
public class RabbitmqListen {

    @RabbitListener(queues = RabbitMqConst.WARN_DIRECT_QUEUE)
    public void receive(byte[] msg) throws UnsupportedEncodingException {
        String me = new String(msg, "UTF-8");
        System.out.println(me);
    }

}
